<template>
  <div>   
     <template v-for="item in menu" >
         <el-submenu :index="item.link" v-if="item.children&&item.children.length>0" >
          <template  slot="title">{{item.name}}</template>
             <el-menu-item-group>
            <MenuNav :menu = "item.children"/>
             </el-menu-item-group>
         </el-submenu>
              <el-menu-item :index="item.link || item.path" v-else  >{{item.name}}</el-menu-item>
     </template>
</div>
</template>
<script>
export default {
    name: 'MenuNav',
    props:{
      menu:{
      type:Array,
      default:()=>{
        return []
      }
    }
    }
}
</script>

<style>

</style>